Report touch events on MS-Windows
authorPo Lu <luangruo@yahoo.com>
Sun, 9 Jun 2024 09:44:25 +0000 (17:44 +0800)
committerPo Lu <luangruo@yahoo.com>
Sun, 9 Jun 2024 12:40:58 +0000 (20:40 +0800)
commit5eb729c0b36a31869cf4928bc7bf5111b6f59ebb
tree322e1c28ceb9e146c610ca6fc01473d374b9242c
parentdcd95d7a77dc1016de72860ecb0623b6377bdc65
Report touch events on MS-Windows

* etc/NEWS: Announce change.

* src/w32fns.c (RegisterTouchWindow_fn): New function.
(w32_createwindow): Assign a base value for touch event
identifiers to the frame, and register for touch input.
(w32_wnd_proc): Forward WM_TOUCH/WM_TOUCHMOVE messages to the
main thread.
(globals_of_w32fns): Load RegisterTouchWindow from user32.dll.

* src/w32term.c (w32_read_socket) <WM_TOUCH>: Detect WM_TOUCH
events, compare and record their touch points with and into the
frame's record of their prior state, and report the same to Lisp.
(pfnCloseTouchInputHandle, pfnGetTouchInputInfo): New variables.
(w32_initialize): Load the above functions from user32.dll.

* src/w32term.h (MAX_TOUCH_POINTS): New definition.
(struct w32_output) <touch_ids, touch_x, touch_y, touch_base>:
New fields.
etc/NEWS
src/w32fns.c
src/w32term.c
src/w32term.h